package com.ccsoft.multds.service;

import com.ccsoft.multds.annotion.WR;
import com.ccsoft.multds.dao.GoodsMapper;
import com.ccsoft.multds.entity.Goods;
import com.ccsoft.multds.utils.MultDSSwitcher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author chanchaw
 * @create 2022-09-16 11:14
 */
@Service
public class GoodsServiceImpl implements GoodsService{
    @Autowired
    private GoodsMapper dao;
    @WR(MultDSSwitcher.WRITE)
    @Override
    public int deleteByPrimaryKey(Integer iid) {
        return dao.deleteByPrimaryKey(iid);
    }

    @WR(MultDSSwitcher.WRITE)
    @Override
    public int insert(Goods row) {
        return dao.insert(row);
    }

    @WR(MultDSSwitcher.WRITE)
    @Override
    public int insertSelective(Goods row) {
        return dao.insertSelective(row);
    }

    @WR(MultDSSwitcher.READ)
    @Override
    public Goods selectByPrimaryKey(Integer iid) {
        return dao.selectByPrimaryKey(iid);
    }

    @WR(MultDSSwitcher.WRITE)
    @Override
    public int updateByPrimaryKeySelective(Goods row) {
        return dao.updateByPrimaryKeySelective(row);
    }

    @WR(MultDSSwitcher.WRITE)
    @Override
    public int updateByPrimaryKey(Goods row) {
        return dao.updateByPrimaryKey(row);
    }

    @WR(MultDSSwitcher.READ)
    @Override
    public List<Goods> selectAll() {
        return dao.selectAll();
    }
}
